#include <stdio.h>

const int UPLIMIT = 999;

int costages[10] = { 6, 2, 5, 5, 4, 5, 6, 3, 7, 6 };
// 0到9数字显示的开销

int countCostage(int num) {
    int result = 0;
    if (num == 0) { return costages[0]; }
    while (num != 0) { result += costages[num % 10]; num /= 10; }
    return result;
}

int main() {
    int result = 0;
    int budget; scanf("%d", &budget);
    for (int i = 0; i <= UPLIMIT; i++) {
        for (int j = 0; j <= UPLIMIT; j++) {
            if (countCostage(i) + countCostage(j) +
            countCostage(i + j) == budget - 4) {
                result++;
            }
        }
    }
    printf("%d", result);
    return 0;
}